﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mails.aspx.cs" Inherits="ProyectoLab4.Mails" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 224px;
        }
        .style3
        {
            width: 718px;
        }
        .style4
        {
            width: 224px;
            height: 149px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table class="style1"  bgcolor="#0072C6">
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td class="style3">
                    <asp:Button ID="btnNuevo" runat="server" Text="Nuevo" Width="100px" 
                        onclick="btnNuevo_Click" BackColor="#0099CC" BorderColor="Red" 
                        ForeColor="White" />
                </td>
                <td>
                    <asp:LinkButton ID="lnkCerrar" runat="server" onclick="lnkCerrar_Click" 
                        PostBackUrl="~/Inicio.aspx" ForeColor="White">Cerrar sesión</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td class="style3">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    <asp:Button ID="btnBandejaEntrada" runat="server" 
                        onclick="btnBandejaEntrada_Click" Text="Bandeja de entrada" Width="170px" 
                        BackColor="#0099CC" BorderColor="Red" ForeColor="White" />
                    <asp:Button ID="btnDestacados" runat="server" onclick="btnDestacados_Click" 
                        Text="Destacados" Width="170px" BackColor="#0099CC" BorderColor="Red" 
                        ForeColor="White" />
                    <asp:Button ID="btnEnviados" runat="server" 
                        onclick="btnEnviados_Click" Text="Enviados" Width="170px" 
                        BackColor="#0099CC" BorderColor="Red" ForeColor="White" />
                    <asp:Button ID="btnBorrador" runat="server" 
                        onclick="btnBorrador_Click" Text="Borradores" Width="170px" 
                        BackColor="#0099CC" BorderColor="Red" ForeColor="White" />
                    <asp:Button ID="btnPapelera" runat="server" onclick="btnPapelera_Click" 
                        style="height: 26px" Text="Papelera" Width="170px" BackColor="#0099CC" 
                        BorderColor="Red" ForeColor="White" />
                </td>
                <td class="style3" rowspan="2">
                    <asp:GridView ID="grdMails" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="id_mail,estado" onrowcommand="grdMails_RowCommand" 
                        BackColor="#3366FF" BorderColor="#00CCFF" style="margin-right: 0px">
                        <Columns>
                            <asp:HyperLinkField DataNavigateUrlFormatString="MailViejo.aspx?id={0}" 
                                NavigateUrl="~/MailViejo.aspx" Text="ABRIR" 
                                DataNavigateUrlFields="id_mail">
                            <ControlStyle Width="100px" Font-Bold="True" ForeColor="Yellow" />
                            <FooterStyle Width="100px" ForeColor="White" />
                            <HeaderStyle Width="100px" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:HyperLinkField>
                            <asp:BoundField DataField="correo_remitente" HeaderText="REMITENTE">
                            <ControlStyle Width="100px" />
                            <FooterStyle Width="100px" />
                            <HeaderStyle Width="100px" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:BoundField>
                            <asp:BoundField DataField="asunto" HeaderText="ASUNTO">
                            <ControlStyle Width="100px" />
                            <FooterStyle Width="100px" />
                            <HeaderStyle Width="100px" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:BoundField>
                            <asp:BoundField DataField="hora_envio" HeaderText="HORA DE ENVIO">
                            <ControlStyle Width="100px" />
                            <FooterStyle Width="100px" />
                            <HeaderStyle Width="100px" ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:BoundField>
                            <asp:CommandField HeaderText="DESTACAR" SelectText="X" 
                                ShowSelectButton="True" UpdateText="" ButtonType="Image" 
                                SelectImageUrl="~/Imagenes/gif_estrella.gif">
                            <HeaderStyle ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:CommandField>
                            <asp:TemplateField HeaderText="DESTACADO">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" 
                                        Checked='<%# Bind("destacado") %>' />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("destacado") %>' 
                                        Enabled="false"/>
                                </ItemTemplate>
                                <ControlStyle Width="100px" />
                                <FooterStyle Width="100px" />
                                <HeaderStyle Width="100px" ForeColor="White" />
                                <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="id_mail" HeaderText="ID MAIL" Visible="False" 
                                DataFormatString="{0:G}" />
                            <asp:ButtonField ButtonType="Image" CommandName="Borrar" DataTextField="estado" 
                                HeaderText="BORRAR" ImageUrl="~/Imagenes/cruz.png">
                            <HeaderStyle ForeColor="White" />
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            </asp:ButtonField>
                            <asp:BoundField DataField="estado" HeaderText="ESTADO" Visible="False">
                            <ControlStyle Width="100px" />
                            <FooterStyle Width="100px" />
                            <HeaderStyle Width="100px" />
                            <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:ButtonField ButtonType="Image" CommandName="Borrar" DataTextField="estado" 
                                HeaderText="RECUPERAR" ImageUrl="~/Imagenes/flecha.png" Visible="False">
                            <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                            <ItemStyle ForeColor="White" HorizontalAlign="Center" />
                            </asp:ButtonField>
                            <asp:ButtonField ButtonType="Image" CommandName="Eliminar" 
                                HeaderText="ELIMINAR" ImageUrl="~/Imagenes/circulo.png" Text="Botón" 
                                Visible="False">
                            <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                            <ItemStyle ForeColor="White" HorizontalAlign="Center" />
                            </asp:ButtonField>
                        </Columns>
                    </asp:GridView>
                </td>
                <td rowspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
